<div class="artCon">
	<div class="bigArt">
		<div id="menuContent" class="menuContent" style="display:none; position: absolute;border: 1px solid #09f;width:253px;overflow:auto;;background-color:#FFFFFF;height:150px;">
			<ul id="treeDemo" class="ztree"></ul>
		</div>
		<form class="form-horizontal" id="mainForm" action="/${orgi}/design/event/${parentid!''}/dataexaddo.html" method="post">
		<input type="hidden" name="name" value="" id="dataexname">
        <div class="artMain artOther" id='dbpanel' data-type='source'>
			<#include "seldatabase.html"/>
        </div>
        <div class="bottomBg">
            <div class="btnWrap">
                <a href="javascript:valideSelTab()" class="btnStyle1">保存</a>
                <input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
            </div>
        </div>
		</form>
    </div>
</div>
<script type="text/javascript">
	var type = 'source' ;
	function valideSelTab(){
		if($('#cubedic_val').val() == ""){
			art.dialog({
				id:"alert",
				content:'请选择迁移的来源数据表'
			});
		}else if($('#sourcedic_val').val() == ""){
			art.dialog({
				id:"alert",
				content:'请选择迁移的目标数据表'
			});
		}else if($('#cubedic_val').val() == $('#sourcedic_val').val()){
			art.dialog({
				id:"alert",
				content:'数据迁移的来源数据表和目标数据表不能使同一个，请重新选择。'
			});
		}else{
			$('#mainForm').submit();
		}
	}
	var setting = {
		view: {
			dblClickExpand: false
		},
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
			onClick: onClick
		}
	};
	var zNodes =[
		{ id:'0', pId:0, name:"公共文件夹", open:true, icon:"/assets/images/imgIco-101.png"}
		<#if databaseList??>
		<#list databaseList as database>
		,{ id:"${database.id!''}", pId:"0", name:"${database.name!''}", icon:"/assets/images/<#if database.databasetype??&&database.databasetype == 'oracle'>imgIco-101<#elseif database.databasetype??&&database.databasetype == 'mysql'>imgIco-100<#elseif database.databasetype??&&database.databasetype == 'sqlserver'>imgIco-102<#elseif database.databasetype??&&database.databasetype == 'rivues'>imgIco-10<#else>imgIco-13</#if>.png",click:"loadURL('/${orgi}/design/event/${parentid!""}/dataex/${database.id!''}/0.html?t='+$('#dbpanel').attr('data-type'),'#cubeList',function(){hideMenu();})"}
		<#if tableDirList??>
		<#list tableDirList as dir>
		<#if dir.databaseid?? && dir.databaseid == database.id>
		,{ id:"${dir.id!''}", pId:"<#if dir.parentid == '0'>${database.id!''}<#else>${dir.parentid!''}</#if>", name:"${dir.name!''}", icon:"/assets/images/icon-file-closed.png",click:"loadURL('/${orgi}/design/event/${parentid!""}/dataex/${database.id!''}/${dir.id!''}.html?t='+$('#dbpanel').attr('data-type'),'#cubeList',function(){hideMenu();})"}
		</#if>
		</#list>
		</#if>
		</#list>
		</#if>
	 ]; 
	 $(document).ready(function(){
		var dbTree = $.fn.zTree.init($("#treeDemo"), setting, zNodes);
		<#if db??>
		dbTree.selectNode(dbTree.getNodeByParam("id", "${db.id!''}", null));
		</#if>
	});
	
	
</script>